Current Location: Home> Function Categories> date_isodate_set

date_isodate_set

DateTime::setISODate alias - Set ISO date
Name:date_isodate_set
Category:Date and time
Programming Language:php
One-line Description:Set the ISO date.

Definition and usage

date_isodate_set() function sets dates according to the ISO 8601 standard, using week and day offsets (rather than using a specific date).

Example

Set the ISO date for Week 5 of 2016:

 <?php
$date = date_create ( ) ;
date_isodate_set ( $date , 2016 , 5 ) ;
echo date_format ( $date , "Ymd" ) ;
?>

Try it yourself

grammar

 date_isodate_set ( object , year , week , day ) ;
parameter describe
object Required. Specifies the DateTime object returned by date_create() .
year Required. The year in the specified date.
week Required. Weeks of the specified date.
day Optional. Specify the offset from the first day of the week. The default is 1.
Similar Functions
Popular Articles